<template>
<h1>EL-日期时间选择器</h1>
  <el-date-picker
      type="date"
      v-model="rq"
      format="YYYY-MM-DD"
      value-format="YYYY-MM-DD"
      @change="console.log(rq)"
  >
  </el-date-picker>

  <el-date-picker
      v-model="time"
      type="datetime"
      format="YYYY-MM-DD HH:mm:ss"
      value-format="YYYY-MM-DD HH:mm:ss"
      @change="console.log(time)"
  >
  </el-date-picker>


  <el-date-picker
      v-model="times"
      type="datetimerange"
      format="YYYY-MM-DD HH:mm:ss"
      value-format="YYYY-MM-DD HH:mm:ss"
      @change="f"
      start-placeholder="开始时间"
      end-placeholder="结束时间"
      range-separator="至"
  >
  </el-date-picker>
</template>

<script setup>
import {ref} from "vue";

const rq=ref('')
const time = ref('');
const times = ref([]);
const f=()=>{
  console.log(times.value[0])
  console.log(times.value[1])
}

String
</script>



<style scoped>

</style>